<?php if(!IS_AJAX){?>

<include file="Public:header" />
<div class="row">
  <div class="col-sm-7 col-md-8 col-lg-9">
    <section class="panel">
      <div class="panel-body">
        <table class="table-bordered table" width="100%" border="0" cellspacing="0" cellpadding="0">
 <thead>
<tr>

    <td align="center">类型名称</td>
    <td align="center">规格列表</td>

  </tr>
</thead>
          <tbody class="ajaxdatalistbox" id="ajaxdatalistbox">
            <?php }?>
            
            
            
            <?php if(IS_AJAX){?>
            <!-- 数据主体 -->
            
            



<notempty name="list"> 






 

<volist name="list" id="vo">
  <tr class="data_list" id="ajaxdatalistbox-{$vo.id}">
    
    <td><a title="修改" class="text-info" href="##" onClick="_openWindow('{:U('edit',array('id'=>$vo['id']))}', 500, '【{$vo.title}】修改', '保存',  function(){ $('#ajaxdatalistboxform').submit();}, '');">{$vo.title}</a>&nbsp;&nbsp;
    
    
    <a href="##" onClick="_openWindow('{:U('Attr/add',array('type_id'=>$vo['id']))}', 500, '【{$vo.title}】添加规格', '保存',  function(){ $('#attrlistbox{$vo.id}form').submit();}, '');">添加规格</a>
    
    
<if condition="getAccessMenu($accessList, 'Admin', 'Type', 'delete')"> | <a class="deleteBtn" href="javascript:void(0);" rel="{:U('delete',array('id'=>$vo['id']))}" data-id="{$vo.id}">删除</a> </if></td>
    <td align="center" style="padding:0;" class="attrBox">
    
    <table style="margin:0; border:none;" class="table-bordered table" width="100%" border="0" cellspacing="0" cellpadding="0">

          <tbody class="attrlistbox" id="attrlistbox{$vo.id}">
</tbody></table>
    <div id="attrlistbox{$vo.id}pages"></div>
    <form action="{:U('Attr/index',array('type_id'=>$vo['id']))}" class="" id="attrlistbox{$vo.id}form"></form>
    
    
    </td>

  </tr>
</volist>

<else/>
<tr>
<td colspan="2" align="center">暂无商品类型信息</td>
</tr>
</notempty>






  
            <?php }?>
            <!-- 数据主体结束 -->
            
            <?php if(!IS_AJAX){?>
          </tbody>
        </table>
        <div id="ajaxdatalistboxpages"></div>
      </div>
    </section>
  </div>
  <div class="col-sm-5 col-md-4 col-lg-3">
    <div class="states-info">
      <div class="panel green-bg">
        <div class="panel-body">
          <div class="row">
            <div class="col-xs-3"> <i class="fa fa-hand-o-right"></i> </div>
            <div class="col-xs-7">
              <h4>添加商品类型</h4>
              <span class="state-title"> <a class="text-success" href="##" onClick="_openWindow('<php> echo U('add')</php>', 500, '添加商品类型', '保存', function(){ $('#ajaxdatalistboxform').submit();}, '');">点击添加商品类型</a> </span> </div>
            <div class="col-xs-2"> <span class="fa fa-angle-right"></span> </div>
          </div>
        </div>
      </div>
    </div>
    <div class="panel">
      <header class="panel-heading"> 搜索 </header>
      <div class="panel-body">
        <form id="ajaxdatalistboxform">
          <div class="input-group m-bot15">
            <input type="text" name="keywords" class="form-control">
            <span class="input-group-btn">
            <button type="button" onClick="$('#ajaxdatalistboxform').trigger('submit');" class="btn btn-default"><i class="fa fa-search"></i></button>
            </span> </div>
        </form>
       
      </div>
    </div>
  </div>
</div>
<include file="Public:footer" />
 <script>
     $('#ajaxdatalistbox').ajaxlist({success:function(){
		 //加载规格列表
		 $('.attrlistbox').ajaxlist({success:function(){
			//加载可选值 
			$('.ajaxdatalistareaval').ajaxlist();
		 }});
	 }});
 </script>

<style>
    .option a.btn{margin-top:5px;}.pagination{margin:4px auto;}
	
	
	
	
	
	
	
</style>
</body></html>
<?php }?>

